Open topic with navigation
Debugger Notes, Hints, and Tips
When using Visual Studio to debug RTX applications, note the following hints and tips.
Debug Behavior
- Deterministic behavior does not exist while using the RTX Debugger. As a result, RTX users should not depend on the execution order of multiple RTSS applications being debugged by multiple RTX Visual Studio Debugger instances.
- If you are unable to debug a RTSS application, make sure the IntervalZero Real-Time Debugger is the selected debugger.
- While debugging, only the process being debugged is frozen when a breakpoint is hit. All other Real-time processes along with the Subsystem continue to run.
- In the event that no debugger is specified in Visual Studio, or you do not see the IntervalZero Real-Time Debugger in the drop-down, after you create a project, try the following:
- Make sure the
IntervalZero.Targets
file is installed in the following directory:
%RTXSDKDir%\DebuggerExtensions\
- Verify that the files
IntervalZeroRtxBaseDm.xaml
and IntervalZeroRemoteRtxBaseDm.xaml
exist in the same directory
If these files exist and you still do not see the IntervalZero Real-Time Debugger, try the following:
- Unload the project, right-click on the project and edit the project file
- Make sure the following line exist near the bottom of the project file:
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="$(RTXSDKDir)\DebuggerExtensions\IntervalZero.targets"
Condition="exists('$(RTXSDKDir)\DebuggerExtensions\IntervalZero.targets')" />
- If you receive an error message when you start debugging, make sure:
- The Subsystem is running. The Subsystem must be running before you can start a Visual Studio debugging session.
- The RtssDebug configuration is selected
- In the Visual Studio Extensions and Updates dialog (Tools > Extensions and Updates), make sure the IntervalZero Real-Time Debugger(x86) is listed as an extension, and that it is installed.
Known Issues and Limitations
- The IntervalZero Real-Time Debugger doesn't allow attaching to a process (you can only debug a process that was launched by the debugger).
- The IntervalZero Real-Time Debugger does not display the Process ID (PID) for RTSS processes being debugged. A GUID is displayed instead. This is expected behavior when Visual Studio is used to debug a non-Windows process. The PID is displayed in the Output window.
- The RTX Debugger does not allow disassembly/single step of RTX system calls (for operational security such as atomic sections).
- You must close the Visual Studio debugging session before you stop the RTX Subsystem. A Green Screen may occur if you use the IntervalZero Real-Time Debugger while the Subsystem is in the process of shutting down.
- Hard-coded (embedded) and data breakpoints are not supported.
- The IntervalZero Real-Time Debugger does not support Single-Step after Break All is used. To work around this, set a breakpoint in the application and press F5.
- Using RtssKill may still list the process under debug running even after process under debug was killed.
- When you hit Break All on a CPU-intensive running RTSS application and then stop debugging, Visual Studio can lose the context. When this occurs, Visual Studio displays a dialog indicating Microsoft Visual Studio has stopped working. To continue, close the program and restart the debug session.
- When you place an instruction pointer on a breakpoint, you need to step twice to move beyond the breakpoint.
- You can step into the functions exported by RTDLL, but cannot step into or set a break pointer in DllMain function.
- Breakpoints are not allowed in an Interrupt Service Routine (ISR).
- AVX2 is not supported by Visual Studio 2015 or Visual Studio 2013. As a result, there is no way to view the AVX2 registers in the IntervalZero Real-Time Debugger.
- The RTSS thread priority shown in the Visual Studio Debugger Threads window will display Normal if the real-time priority value does not correspond to a Windows thread priority. RTSS thread priority values range from 0 to 127 and Windows thread priorities range from -15 to 15. If a real-time priority value matches a Windows value, the priority text displayed in the debugger Threads window will not be meaningful.
Accessing Memory Outside the RTX Thread Stack
During most exceptions, the Visual Studio debugger will stop and jump to the source. Since RTX does not currently provide process-to-process memory protection, if an attempt is made to access memory outside the RTX allocated stack, an RTX exception stack fault occurs. In this case, Windows also generates an exception, recognizing the Access Violation. This causes a double-fault, resulting in the Visual Studio Debugger being unable to proceed.